#
# Copyright 2014-2016 CyberVision, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set(CMAKE_SYSTEM_NAME QNX)

if("$ENV{QNX_TARGET_ARCH}" STREQUAL "")
    message(STATUS "=================================================")
    message(STATUS "System variable QNX_TARGET_ARCH is not set!")
    message(STATUS "For Linux host choose one of: \n gcc_ntoarmv7le_cpp-ne \n gcc_ntox86_cpp-ne \n gcc_ntox86_gpp \n gcc_ntoarmv7le \n gcc_ntox86 \n gcc_ntoarmv7le_cpp \n gcc_ntoarmv7le_gpp \n gcc_ntox86_cpp \n ")
    message(STATUS "=================================================")
    message(FATAL_ERROR "Stopped")
endif()

set(arch $ENV{QNX_TARGET_ARCH})

set(CMAKE_C_COMPILER qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER QCC)
set(CMAKE_CXX_COMPILER_TARGET ${arch})